package com.carleasoft.mps.core.exceptions;

import com.carleasoft.mps.core.result.BaseResult;
import lombok.Data;
import lombok.ToString;

/**
 * 通用基础异常
 *
 * @author Alay
 * @date 2021-07-07 13:40
 * @project jmrh
 */
@Data
@ToString
public class BaseRunTimeException extends RuntimeException {

    private String code;

    private String msg;

    public BaseRunTimeException() {
    }

    public BaseRunTimeException(String code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public BaseRunTimeException(BaseResult baseResult) {
        super(baseResult.getMessage());
        this.code = baseResult.getCode();
        this.msg = baseResult.getMessage();
    }
}
